package pro.softzhang.algo.lc1700;

import pro.softzhang.algo.flag.knowledge.KGraph;
import pro.softzhang.algo.flag.x.XInteresting;

/**
 *
 */
@KGraph
@XInteresting
public class LC1791_FindCenterOfStarGraph {
    public static void main(String[] args) {
        int[][] edges = {{1, 2}, {2, 3}, {4, 2}};
        System.out.println(new Solution().findCenter(edges));
    }

    /**
     *
     */
    static
    class Solution {
        public int findCenter(int[][] edges) {
            if (edges[0][0] == edges[1][0] || edges[0][1] == edges[1][1])
                return edges[0][0];
            return edges[0][1];
        }
    }
}
